package com.example.demo.service.impl;


import com.example.demo.core.base.BaseServiceImpl;
import com.example.demo.core.exception.NotFoundException;
import com.example.demo.dao.UserDao;
import com.example.demo.entity.User;
import com.example.demo.service.service.UserService;
import org.springframework.stereotype.Service;


/**
 * @author yujie
 */
@Service
public class UserServiceImpl extends BaseServiceImpl<UserDao, User> implements UserService {


    @Override
    public User getByUsername(String username) {
        return baseDao.
                findByPhone(username).
                orElseThrow(()-> new NotFoundException("对不起没有，您还没有成为我们系统用户"));
    }


}
